
#include "Debug_t.hh"
#include <iostream>
#include <QtTest/QtTest>
#include "Debug.hh"


using namespace std;
using namespace TC;


void Debug_t::tests()
{
  {
    Debug log(Debug::e_Info,__FILE__,__LINE__);
    ostream& ds = log.getStream();
    if(!ds.good()) {
      cerr << "Debug stream is not good!" << endl;
      if(ds.eof())  cerr << "Debug stream eof bit is set" << endl;
      if(ds.fail())  cerr << "Debug stream fail bit is set" << endl;
      if(ds.bad())  cerr << "Debug stream bad bit is set" << endl;
      QVERIFY(false);
    }
    else {
      ds << "Going to debug stream" << endl;
    }
    QVERIFY(true);
  }

  TC_LOG_PRINTF("%s\n","Direct write to FILE stream");
  TC_LOG_WRITE(Debug::e_Info,"Info message");
  TC_LOG_LDEBUG("High debug message");
  TC_LOG_DEBUG("Debug message");
  TC_LOG_INFO("Informational message");
  TC_LOG_WARN("Warning " << "message");
  TC_LOG_ERROR("Error message (ignore)");
  TC_LOG_FATAL("Fatal message (ignore)");
  TC_LOG_INFO("TC_FUNCTION=" << TC_FUNCTION);
  QVERIFY(true);

  TC_LOG_PRINTF("%s %d\n", "Direct write to log", 9);
  QVERIFY(true);  
}
  



